﻿@model ETA.Web.Controllers.AddHelpReqDTO
@{
    ViewBag.Title = "海外援助";
    var info = TempData["Info"];
    var hiddenInfo = "";
    if (info != null)
    {
        hiddenInfo = info.ToString();
    }
}


<div class="mainContentWithBorder" style="height: 500px">
    <input type="hidden" id="hiddenInfo" value="@hiddenInfo"/>
    <div class="sosLeft">
        <h2><strong>历史求援记录</strong></h2>
        <table id="tbSOS" class="table table-hover">
            <tbody>
            </tbody>
        </table>
        <div id="pp" class="pagination"></div>
    </div>
    <div class="sosRight">
        <div>
            @using (Html.BeginForm("AddHelpRequest", "SOS", FormMethod.Post, new { id = "HelpRequestForm" }))
            {
                <p class="sosinfo">事务提交</p>
                <p>
                    <label>事物类型:</label>
                    <input type="radio" name="Type" value="0" />求援 
            <input type="radio" name="Type" value="1" />建议 
                </p>
                <p>
                    <label>事物分类:</label>
                    <select id="Category" name="Category">
                        <option selected="" value="-1">（选择事务分类）</option>
                        <option value="0">工作类</option>
                        <option value="1">生活类</option>
                        <option value="2">法律纠纷类</option>
                    </select>
                </p>
                <p>
                    <label>正文:</label>
                    <textarea id="Content" name="Content">

            </textarea>
                </p>
                <button type="button" class="btn btn-primary btn-lg btn-block" id="btnSubmitHelp">提交</button>
            }
        </div>
        <div class="commentSos" id="commentSos">
            <input type="hidden" id="handlerSosId"/>
            <div class="commentHeader">
                <span>处理结果评价</span>
                <button type="button" class="close" id="btnCloseCommitSos"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            </div>
            <div>
                <ul class="commentUl">
                    <li>
                        <input type="radio" value="1" name="commentSosRadio" />满意</li>
                    <li>
                        <input type="radio" value="2" name="commentSosRadio" />一般</li>
                    <li>
                        <input type="radio" value="3" name="commentSosRadio" />不满意</li>
                </ul>
            </div>
             <div class="clear"></div>
            <p class="pSumbitSosComment">
                <button type="button" class="btn btn-default btn-lg btn-block" id="btnCommit">提交</button>
            </p>
        </div>
    </div>
    <div class="clear"></div>
</div>


<script id="sos-template" type="text/x-handlebars-template">
    {{#each sos}}
            <tr>
                <td class="EnabledClick" data-sosid="{{RecordId}}">{{Date}}</td>
                <td class="EnabledClick" data-sosid="{{RecordId}}">{{Type}}</td>
                <td class="EnabledClick" data-sosid="{{RecordId}}">{{Category}}</td>
                <td class="EnabledClick" data-sosid="{{RecordId}}">{{Status}}</td>
                {{#if EnabledCommit}} 
                      <td>
                          <button type="button" class="btn btn-warning btnCommitSos" data-sosid="{{RecordId}}">点评</button></td>
                {{else}}
                      <td>{{Comment}}</td>
                {{/if}} 
            </tr>
    {{/each}}
</script>

<script id="sosInfo-template" type="text/x-handlebars-template">
    <div id="divSosInfo">
        <p>
            <label for="Type" class="logUserInfoLabel">事物类型：</label>
            <span id="Type">{{Type}}</span>
        </p>
        <p>
            <label for="CategorySpan" class="logUserInfoLabel">事物分类：</label>
            <span id="CategorySpan">{{Category}}</span>
        </p>
        <hr />
        <p>
            <label for="Content" class="logUserInfoLabel">正文：</label>
            <textarea id="ContentText" style="height: 100px;">{{Content}}</textarea>
        </p>
    </div>
</script>


@section scripts
{
    @Scripts.Render("~/bundles/JSTmp")
    @Scripts.Render("~/bundles/Page")
    @Scripts.Render("~/bundles/SOS")
}